package com.itheima.polymorphsm1;

/**
 * @author jiangxun
 * @date 11-17-2024
 */
public class Test {
    public static void main(String[] args) {
        // 多态
        // 1 对象多态，行为多态
        Animal animal1 = new Wolf();
        animal1.eat();
        System.out.println(animal1.name);

        Animal animal2 = new Tortoise();
        animal2.eat();
        System.out.println(animal2.name);
    }
}
